<template>
  <div>
    <el-tabs
      type="border-card"
      v-model="activeTab"
      @tab-click="handleTabClick"
      style="box-shadow: none"
    >
      <el-tab-pane label="练习模板" name="练习模板" lazy>
        <exercise-manage-view />
      </el-tab-pane>
      <el-tab-pane label="记录检索" name="记录检索" lazy>
        <record-query-view />
      </el-tab-pane>
      <el-tab-pane label="记录统计" name="记录统计" lazy>
        <record-statistic-view />
      </el-tab-pane>
      <el-tab-pane label="教员设置" name="教员设置" lazy>
        <coach-manage-view />
      </el-tab-pane>
      <el-tab-pane label="预设内容" name="预设内容" lazy>
        <evaluation-preset-view />
      </el-tab-pane>
      <el-tab-pane label="完成度统计" name="完成度统计" lazy>
        <annualStatisicView />
      </el-tab-pane>
      <el-tab-pane label="打印练习册" name="打印练习册" lazy>
        <printExercises />
      </el-tab-pane>
      <el-tab-pane label="数据导入" name="数据导入" lazy>
        <data-import-view v-if="level >= 3" />
        <el-alert
          v-else
          title="您无权访问此页面"
          :closable="false"
          type="warning"
        ></el-alert>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import exerciseManageView from "@/views/manager/exerciseManage/index.vue";
import evaluationPresetView from "@/views/manager/evaluationPreset/index.vue";
import recordQueryView from "@/views/manager/recordQuery/index.vue";
import recordStatisticView from "@/views/manager/recordStatistic/index.vue";
import coachManageView from "@/views/manager/coachManage/index.vue";
import dataImportView from "@/views/manager/dataImport/index.vue";
import annualStatisicView from "@/views/manager/annualStatisic";
import printExercises from "@/views/manager/printExercises";
export default {
  name: "managerView",
  components: {
    exerciseManageView,
    evaluationPresetView,
    recordQueryView,
    recordStatisticView,
    coachManageView,
    dataImportView,
    annualStatisicView,
    printExercises,
  },
  computed: {
    level() {
      return this.$store.state.loginLevel;
    },
  },
  data() {
    return {
      activeTab: "练习模板",
    };
  },
  methods: {
    handleTabClick() {
      // tab, event
      // console.log(tab, event);
    },
  },
};
</script>
